# utils.py
import os

high_score_file = os.path.join("history_score", "high_score.txt")

def load_high_score():
    """加载历史最高分"""
    if os.path.exists(high_score_file):
        with open(high_score_file, "r") as file:
            return int(file.read().strip())
    else:
        return 0

def save_high_score(new_high_score):
    """保存新的历史最高分"""
    with open(high_score_file, "w") as file:
        file.write(str(new_high_score))